home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / System Utilities / Speech Manager1.1.1 / Interfaces ƒ / Speech.a next >
Encoding:
Text File  |  1993-07-20  |  6.5 KB  |  338 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Speech.a
  3. ;
  4. ;    Contains:    xxx put contents here xxx
  5. ;
  6. ;    Written by:    xxx put writers here xxx
  7. ;
  8. ;    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  9. ;
  10. ;    Change History (most recent first):
  11. ;
  12. ;         <1>      6/1/93    TIM        first checked in
  13. ;
  14. ;
  15.  
  16.  
  17.  
  18.  
  19.  
  20.     IF &TYPE('__INCLUDINGSPEECHEQU__') = 'UNDEFINED' THEN
  21. __INCLUDINGSPEECHEQU__    SET    1
  22.  
  23.  
  24.     INCLUDE 'FSEqu.a'    ; for FSSpec
  25.     INCLUDE 'Traps.a'    ; for SoundDispatch
  26.  
  27.  
  28.  
  29. gestaltSpeechAttr         EQU 'ttsc'    ; Gestalt Manager selector for Speech Attributes 
  30. gestaltSpeechMgrPresent     EQU 0    ; Gestalt bit which indicates that Speech Manager exists 
  31.  
  32.  
  33. kTextToSpeechSynthType        EQU 'ttsc'    ; Text-to-Speech Synthesizer component type     
  34. kTextToSpeechVoiceType        EQU 'ttvd'    ; Text-to-Speech Voice resource type             
  35. kTextToSpeechVoiceFileType    EQU 'ttvf'    ; Text-to-Speech Voice file type                 
  36. kTextToSpeechVoiceBundleType    EQU 'ttvb'    ; Text-to-Speech Voice Bundle file type        
  37.  
  38.                 ; Speech Manager error codes (Range from 240 - 259) 
  39. noSynthFound     EQU -240
  40. synthOpenFailed     EQU -241
  41. synthNotReady    EQU -242
  42. bufTooSmall     EQU -243
  43. voiceNotFound    EQU -244
  44. incompatibleVoice    EQU -245
  45. badDictFormat     EQU -246
  46.  
  47.         
  48.                 ; constants for SpeakBuffer and TextDone callback controlFlags bits 
  49. kNoEndingProsody     EQU 1
  50. kNoSpeechInterrupt     EQU 2
  51. kPreflightThenPause    EQU 4
  52.  
  53.  
  54.                 ; constants for StopSpeechAt and PauseSpeechAt 
  55. kImmediate        EQU 0
  56. kEndOfWord        EQU 1
  57. kEndOfSentence    EQU 2
  58.  
  59.  
  60. soStatus        EQU 'stat'        ; GetSpeechInfo & SetSpeechInfo selectors 
  61. soErrors        EQU 'erro'
  62. soInputMode        EQU 'inpt'
  63. soCharacterMode    EQU 'char'
  64. soNumberMode    EQU 'nmbr'
  65. soRate        EQU 'rate'
  66. soPitchBase        EQU 'pbas'
  67. soPitchMod        EQU 'pmod'
  68. soVolume        EQU 'volm'
  69. soSynthType        EQU 'vers'
  70. soRecentSync    EQU 'sync'
  71. soPhonemeSymbols    EQU 'phsy'
  72. soCurrentVoice    EQU 'cvox'
  73. soCommandDelimiter    EQU 'dlim'
  74. soReset        EQU 'rset'
  75. soCurrentA5        EQU 'myA5'
  76. soRefCon        EQU 'refc'
  77. soTextDoneCallBack    EQU 'tdcb'
  78. soSpeechDoneCallBack    EQU 'sdcb'
  79. soSyncCallBack    EQU 'sycb'
  80. soErrorCallBack    EQU 'ercb'
  81. soPhonemeCallBack    EQU 'phcb'
  82. soWordCallBack    EQU 'wdcb'
  83. soSynthExtension    EQU 'xtnd'
  84.  
  85.  
  86.  
  87. * Speaking Mode Constants 
  88.  
  89. modeText        EQU 'TEXT'        ; input mode constants                 
  90. modeTX        EQU 'TX'
  91. modePhonemes    EQU 'PHON'
  92. modePH        EQU 'PH'
  93. modeNormal        EQU 'NORM'        ; character mode and number mode constants 
  94. modeLiteral        EQU 'LTRL'
  95.  
  96.                 ; GetVoiceInfo selectors                 
  97. soVoiceDescription    EQU 'info'        ; gets basic voice info                 
  98. soVoiceFile        EQU 'fref'        ; gets voice file ref info             
  99.  
  100.  
  101. SpeechChannelRecord     RECORD 0
  102. data        DS.L 1
  103.         ENDR
  104.  
  105.  
  106. VoiceSpec    RECORD 0
  107. creator    DS.L 1            ; creator id of required synthesizer     
  108. id    DS.L 1            ; voice id on the specified synth         
  109.     ENDR
  110.  
  111.  
  112. kNeuter    EQU 0
  113. kMale    EQU 1
  114. kFemale     EQU 2            ; returned in gender field below         
  115.  
  116.  
  117. VoiceDescription    RECORD 0
  118. length        DS.L 1        ; size of structure - set by application     
  119. voice        DS   VoiceSpec    ; voice creator and id info                 
  120. version        DS.L 1        ; version code for voice                     
  121. name        DS.B 64        ; name of voice                             
  122. comment        DS.B 256        ; additional text info about voice         
  123. gender        DS.W 1        ; neuter, male, or female                    
  124. age        DS.W 1        ; approximate age in years                 
  125. script        DS.W 1        ; script code of text voice can process     
  126. language        DS.W 1        ; language code of voice output speech     
  127. region        DS.W 1        ; region code of voice output speech         
  128. reserved        DS.L 4        ; always zero - reserved for future use    
  129.         ENDR
  130.  
  131.  
  132.  
  133. VoiceFileInfo     RECORD 0
  134. fileSpec        DS   FSSpec        ; volume, dir, & name information for voice file 
  135. resID        DS.W 1        ; resource id of voice in the file 
  136.         ENDR
  137.  
  138. SpeechStatusInfo     RECORD 0
  139. outputBusy        DS.B 1        ; TRUE if audio is playing         
  140. outputPaused    DS.B 1        ; TRUE if channel is paused         
  141. inputBytesLeft    DS.L 1         ; bytes left to process             
  142. phonemeCode        DS.W 1        ; opcode for cur phoneme             
  143.         ENDR
  144.  
  145. SpeechErrorInfo     RECORD 0
  146. count        DS.W 1        ; # of errs since last check         
  147. oldest        DS.W 1        ; oldest unread error                 
  148. oldPos        DS.L 1        ; char position of oldest err         
  149. newest        DS.W 1        ; most recent error                 
  150. newPos        DS.L 1        ; char position of newest err         
  151.         ENDR
  152.  
  153. SpeechVersionInfo     RECORD 0
  154. synthType        DS.B 4        ; always ‘ttsc’                     
  155. synthSubType    DS.B 4        ; synth flavor                     
  156. synthManufacturer    DS.B 4        ; synth creator ID                 
  157. synthFlags        DS.L 1        ; synth feature flags                 
  158. synthVersion    DS.B 7        ; !!!! NEED TO DEFINE 'NumVersion' !!!!   synth version number             
  159.         ENDR
  160.  
  161. PhonemeInfo     RECORD 0
  162. opcode        DS.W 1        ; opcode for the phoneme             
  163. phStr        DS.B 16        ; corresponding char string         
  164. exampleStr        DS.B 32        ; word that shows use of phoneme     
  165. hiliteStart        DS.W 1        ; segment of example word that         
  166. hiliteEnd        DS.W 1        ; should be hilighted (ala TextEdit) 
  167.         ENDR
  168.  
  169. PhonemeDescriptor     RECORD 0
  170. phonemeCount    DS.W 1        ; # of elements         
  171. thePhonemes        DS   PhonemeInfo;     ; element list         
  172.         ENDR
  173.  
  174. SpeechXtndData     RECORD 0
  175. synthCreator    DS.B 4        ; synth creator id     
  176. synthData        DS.B 2        ; data TBD by synth     
  177.         ENDR
  178.  
  179. DelimiterInfo     RECORD 0
  180. startDelimiter    DS.B 2        ; defaults to “[[“     
  181. endDelimiter    DS.B 2        ; defaults to “]]“     
  182.         ENDR
  183.  
  184.     MACRO
  185.     _SpeechManagerVersion
  186.     MOVE.L #$0000000C,D0
  187.     _SoundDispatch
  188.     ENDM
  189.  
  190.     MACRO
  191.     _MakeVoiceSpec
  192.     MOVE.L #$0604000C,D0
  193.     _SoundDispatch
  194.     ENDM
  195.  
  196.     MACRO
  197.     _CountVoices
  198.     MOVE.L #$0108000C,D0
  199.     _SoundDispatch
  200.     ENDM
  201.  
  202.     MACRO
  203.     _GetIndVoice
  204.     MOVE.L #$030C000C,D0
  205.     _SoundDispatch
  206.     ENDM
  207.  
  208.     MACRO
  209.     _GetVoiceDescription
  210.     MOVE.L #$0610000C,D0
  211.     _SoundDispatch
  212.     ENDM
  213.  
  214.     MACRO
  215.     _GetVoiceInfo
  216.     MOVE.L #$0614000C,D0
  217.     _SoundDispatch
  218.     ENDM
  219.  
  220.     MACRO
  221.     _NewSpeechChannel
  222.     MOVE.L #$0418000C,D0
  223.     _SoundDispatch
  224.     ENDM
  225.  
  226.     MACRO
  227.     _DisposeSpeechChannel
  228.     MOVE.L #$021C000C,D0
  229.     _SoundDispatch
  230.     ENDM
  231.  
  232.     MACRO
  233.     _SpeakString
  234.     MOVE.L #$0220000C,D0
  235.     _SoundDispatch
  236.     ENDM
  237.  
  238.     MACRO
  239.     _SpeakText
  240.     MOVE.L #$0624000C,D0
  241.     _SoundDispatch
  242.     ENDM
  243.  
  244.     MACRO
  245.     _SpeakBuffer
  246.     MOVE.L #$0828000C,D0
  247.     _SoundDispatch
  248.     ENDM
  249.  
  250.     MACRO
  251.     _StopSpeech
  252.     MOVE.L #$022C000C,D0
  253.     _SoundDispatch
  254.     ENDM
  255.  
  256.     MACRO
  257.     _StopSpeechAt
  258.     MOVE.L #$0430000C,D0
  259.     _SoundDispatch
  260.     ENDM
  261.  
  262.     MACRO
  263.     _PauseSpeechAt
  264.     MOVE.L #$0434000C,D0
  265.     _SoundDispatch
  266.     ENDM
  267.  
  268.     MACRO
  269.     _ContinueSpeech
  270.     MOVE.L #$0238000C,D0
  271.     _SoundDispatch
  272.     ENDM
  273.  
  274.     MACRO
  275.     _SpeechBusy
  276.     MOVE.L #$003C000C,D0
  277.     _SoundDispatch
  278.     ENDM
  279.  
  280.     MACRO
  281.     _SpeechBusySystemWide
  282.     MOVE.L #$0040000C,D0
  283.     _SoundDispatch
  284.     ENDM
  285.  
  286.     MACRO
  287.     _SetSpeechRate
  288.     MOVE.L #$0444000C,D0
  289.     _SoundDispatch
  290.     ENDM
  291.  
  292.     MACRO
  293.     _GetSpeechRate
  294.     MOVE.L #$0448000C,D0
  295.     _SoundDispatch
  296.     ENDM
  297.  
  298.     MACRO
  299.     _SetSpeechPitch
  300.     MOVE.L #$044C000C,D0
  301.     _SoundDispatch
  302.     ENDM
  303.  
  304.     MACRO
  305.     _GetSpeechPitch
  306.     MOVE.L #$0450000C,D0
  307.     _SoundDispatch
  308.     ENDM
  309.  
  310.     MACRO
  311.     _SetSpeechInfo
  312.     MOVE.L #$0654000C,D0
  313.     _SoundDispatch
  314.     ENDM
  315.  
  316.     MACRO
  317.     _GetSpeechInfo
  318.     MOVE.L #$0658000C,D0
  319.     _SoundDispatch
  320.     ENDM
  321.  
  322.     MACRO
  323.     _TextToPhonemes
  324.     MOVE.L #$0A5C000C,D0
  325.     _SoundDispatch
  326.     ENDM
  327.  
  328.     MACRO
  329.     _UseDictionary
  330.     MOVE.L #$0460000C,D0
  331.     _SoundDispatch
  332.     ENDM
  333.  
  334.  
  335.     ENDIF    ; already included...
  336.  
  337.  
  338.